﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Drawing;
using ZX.WebApp;

namespace ZX.WebApp.Crm.BasePages
{
	public partial class WorkflowMap : ZX.Web.UI.Controls.BasePage
	{
        ZX.WebApp.CrmWorkFlowService.WorkFlowServiceClient client = new ZX.WebApp.CrmWorkFlowService.WorkFlowServiceClient();
        public string workflowId
        {
            get;
            set;
        }
        public string workflowInsId
        {
            get;
            set;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BaseUserPage.LoadWaitPage();
            }
            if (Request["workflowId"] != null && Request["WorkFlowInstanceId"] != null)
            {
                workflowId = Request["workflowId"].ToString();
                workflowInsId = Request["WorkFlowInstanceId"].ToString();
                string sb1 = "WfMonitorPic.aspx?WorkFlowId=" + workflowId + "&WorkFlowInstanceId=" + workflowInsId;
                Image1.ImageUrl = sb1;
                Image1.DataBind();
                Init(workflowInsId);


            }
        }
        public void Init(string workflowInsId)
        {
            ////DataTable dts = client.GetAuditMsgTableByFlow(Request["WorkflowInsId"]);
            DataView dts = this._bll.GetDataBySqlComm(string.Format("select * from HF_WorkTaskInstanceView where ((status='3' OR status='4' OR status='5' or Message<>'') or OperType='12') and WorkFlowInstanceId='{0}'", workflowInsId)).DefaultView;
            //DataView dts = client.GetWorkflowdetail(Request["WorkflowInsId"]).DefaultView;
            dts.Sort = "timeSort,taskStartTime,OperDateTime Asc";

            //DataView dt = client.GetWorkflowdetail(workflowInsId).DefaultView;
           // dt.Sort = "taskStartTime,OperDateTime Asc";
            gvworkflowMessage.DataSource = dts;
            gvworkflowMessage.DataBind();
        }
    
	}
}